﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="keyword_edit.aspx.cs" Inherits="He.Web.manage.weixin.keyword_edit" %>
<%@ Register Src="../_uc/head_edit.ascx" TagPrefix="uc" TagName="head_edit" %>
<%@ Register Src="../_uc/head.ascx" TagPrefix="uc" TagName="head" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>编辑关键词</title>
<uc:head runat="server" ID="uchead" />
<uc:head_edit runat="server" ID="uchead_edit" />
<link href="../css/wx.css" rel="stylesheet" type="text/css" />
<script src="../../plug/artDialog/artDialog.js?skin=default" type="text/javascript"></script>
<script src="../../plug/artDialog/plugins/iframeTools.js" type="text/javascript"></script>
<script src="../js/wx_function.js" type="text/javascript"></script>
</head>
<body style="padding: 10px;">
<form id="form1" runat="server">
  <asp:HiddenField ID="hidArticleIds" runat="server" />
  <div class="navigation"> <span class="back"><a href='keyword_list.aspx'>返回列表</a></span> <b>您当前的位置：首页 &gt; 微信公众号管理
    &gt;编辑关键词</b> </div>
  <div class="spClear"> </div>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="msgtable">
    <tr>
      <th colspan="2" align="left"> 编辑关键词 </th>
    </tr>
    <tr>
      <td width="15%" align="right"> 关键词： </td>
      <td width="85%"><asp:TextBox ID="txtKeyword" runat="server" CssClass="input w380 required" MaxLength="100"
                    HintTitle="关键词" HintInfo="控制在100个字数内，标题文本尽量不要太长。"></asp:TextBox>
      </td>
    </tr>
    <tr>
      <td align="right"> 回复类型： </td>
      <td><asp:DropDownList ID="ddlMsgType" CssClass="required" runat="server" Enabled="false"
                    OnSelectedIndexChanged="ddlMsgType_SelectedIndexChanged" AutoPostBack="true">
          <asp:ListItem Value="">请选择回复类型</asp:ListItem>
          <asp:ListItem Value="text">纯文本</asp:ListItem>
          <asp:ListItem Value="news">文章</asp:ListItem>
        </asp:DropDownList>
      </td>
    </tr>
    <asp:Panel ID="pnText" runat="server" Visible="false">
      <tr>
        <td align="right"> 纯文本回复： </td>
        <td><asp:TextBox ID="txtAnswer" runat="server" CssClass="textarea wh380" MaxLength="250"
                        HintTitle="纯文本回复" HintInfo="控制在200个字数内。" TextMode="MultiLine"></asp:TextBox>
        </td>
      </tr>
      </asp:Panel>
    <asp:Panel ID="pnNews" runat="server" Visible="false">
      <tr>
        <td align="right"> 回复文章： </td>
        <td><input type="button" class="submit" value="添加文章" onclick="addArticle('',1)" /> <a href="javascript:;" onclick="delAllRows()">清空重选</a>
        </td>
      </tr>
      <tr>
        <td></td>
        <td><div class="media">
            <div class="mediaPanel">
              <%if (action == He.Web.UI.Enums.ActionEnum.Edit.ToString()&&!Page.IsPostBack)
          { %>
              <%
              He.BLL.article abll = new He.BLL.article();
              string[] idArr = model.article_id.Split(',');
              if (idArr.Length > 0)
              {
                  for(int i=0;i<idArr.Length;i++)
                  {
                      int aid = Convert.ToInt32(idArr[i]);
                      if (abll.Exists(aid))
                      {
                          He.Model.article article = abll.GetModel(aid);
                          if (i == 0)
                          {%>
              <div class="mediaImg">
                <div class="mediaImgPanel"> <img width="365" src="<%=article.img_url %>"></div>
                <div class="mediaImgFooter">
                  <p class="mesgTitleTitle left"><%=article.title%></p>
                  <div class="clr"> </div>
                </div>
              </div>
              <div class="clr"> </div>
              <div class="mediaContent">
              <%}
                if(i>0)
                          {%>
                <div class="mediaMesg"> <span class="mediaMesgDot"></span>
                  <div class="mediaMesgTitle left">
                    <p class="left"> <%=article.title%></p>
                    <div class="clr"> </div>
                  </div>
                  <div class="mediaMesgIcon right"> <img src="<%=article.img_url %>" width="45" height="45"></div>
                  <div class="clr"> </div>
                </div>
                <%}
                  }
                }
                if(idArr.Length>0)
                {%>
              </div>
              <%}
              }
              } %>
            </div>
          </div></td>
      </tr>
      <tr>
        <td align="right"> 外链地址： </td>
        <td><asp:TextBox ID="txtLinkUrl" runat="server" CssClass="input w380 url" MaxLength="250"
                        HintTitle="该网站的网址" HintInfo="请填写该网站的网址，以“http://”开头，小于250个字符。"></asp:TextBox>
        </td>
      </tr>
      </asp:Panel>
    <tr>
      <td align="right"> 排序： </td>
      <td><asp:TextBox ID="txtSortId" runat="server" CssClass="input required number" size="10"
                    MaxLength="10" HintTitle="单页的排序" HintInfo="纯数字，数值越小越靠前。">0</asp:TextBox>
      </td>
    </tr>
  </table>
  <div style="margin-top: 10px; text-align: center;">
    <asp:Button ID="btnSave" runat="server" Text="确认保存" CssClass="submit" OnClientClick="return validSubmitKeyword()" OnClick="btnSave_Click" />
  </div>
</form>
</body>
</html>
